Skip to content

feat: Add SearXNG as web search provider#534

Open
truongvinht wants to merge 5 commits intosipeed:mainfrom
truongvinht:feat/searxng
Open

feat: Add SearXNG as web search provider#534
truongvinht wants to merge 5 commits intosipeed:mainfrom
truongvinht:feat/searxng

Conversation

@truongvinht
Copy link

@truongvinht truongvinht commented Feb 20, 2026

📝 Description

Adds SearXNG as a third web search backend alongside DuckDuckGo and Brave.

Motivation:

  • DuckDuckGo blocks datacenter IPs (Oracle Cloud, AWS, etc.), returning empty/blocked responses (138 bytes)
  • Brave Search eliminated their free API tier (Feb 12, 2026), now requiring $5/month minimum
  • SearXNG is self-hosted, free, and aggregates 70+ search engines with a native JSON API

Configurable via config.json. Fully backwards compatible — existing configs without the searxng block work unchanged.

🗣️ Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 📖 Documentation update
  • ⚡ Code refactoring (no functional changes, no api changes)

🤖 AI Code Generation

  • 🤖 Fully AI-generated (100% AI, 0% Human)
  • 🛠️ Mostly AI-generated (AI draft, Human verified/modified)
  • 👨‍💻 Mostly Human-written (Human lead, AI assisted or none)

🔗 Related Issue

No existing issue. DuckDuckGo IP blocking and Brave free tier removal affect all users deploying PicoClaw on cloud VMs.

📚 Technical Context (Skip for Docs)

🧪 Test Environment

  • Hardware: Oracle Cloud E2.1.Micro (1 OCPU, 1GB RAM)
  • OS: Ubuntu 22.04
  • Model/Provider: DeepSeek V3
  • Channels: Discord

📸 Evidence (Optional)

Click to view Logs/Screenshots

Feb 20 13:56:05 instance-20260215-1129 picoclaw[2394]: 2026/02/20 13:56:05 [2026-02-20T13:56:05Z] [INFO] agent: LLM requested tool calls {tools=[web_search], count=1, iteration=1, agent_id=main}
Feb 20 13:56:05 instance-20260215-1129 picoclaw[2394]: 2026/02/20 13:56:05 [2026-02-20T13:56:05Z] [INFO] agent: Tool call: web_search({"count":10,"query":"OpenClaw AI agent framework news 2026"}) {iteration=1, agent_id=main, tool=web_search}
Feb 20 13:56:05 instance-20260215-1129 picoclaw[2394]: 2026/02/20 13:56:05 [2026-02-20T13:56:05Z] [INFO] tool: Tool execution started {tool=web_search, args=map[count:10 query:OpenClaw AI agent framework news 2026]}
Feb 20 13:56:06 instance-20260215-1129 picoclaw[2394]: 2026/02/20 13:56:06 [2026-02-20T13:56:06Z] [INFO] tool: Tool execution completed {tool=web_search, duration_ms=1163, result_length=3152}
Feb 20 13:56:20 instance-20260215-1129 picoclaw[2394]: 2026/02/20 13:56:20 [2026-02-20T13:56:20Z] [INFO] agent: Response: Based on the search results, here's the latest news about OpenClaw:....

☑️ Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • I have updated the documentation accordingly.

truongvinht and others added 4 commits February 20, 2026 12:02
Implements SearXNG as a third web search provider to address Oracle Cloud
datacenter IP blocking issues and provide a cost-free, self-hosted alternative
to commercial search APIs.

Changes:
- Add SearXNGConfig struct with Enabled, BaseURL, and MaxResults fields
- Implement SearXNGSearchProvider with JSON API integration
- Update provider priority: Perplexity > Brave > SearXNG > DuckDuckGo
- Wire SearXNG configuration through agent tool registration
- Add default config values (disabled by default, empty BaseURL)

Benefits:
- Solves DuckDuckGo datacenter IP blocking (138 bytes redirect responses)
- Zero-cost alternative to Brave Search API ($5/1000 queries)
- Self-hosted solution with 70+ aggregated search engines
- Privacy-focused with no rate limits or API keys required
- Ideal for Oracle Cloud, GCP, AWS, and Azure VM deployments

The implementation follows the existing provider interface pattern and
maintains backward compatibility with all existing search providers.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Update README to document the new SearXNG search provider option alongside
existing Brave, DuckDuckGo, and Perplexity providers.

Changes:
- Document provider priority order: Perplexity > Brave > SearXNG > DuckDuckGo
- Add SearXNG configuration examples in Quick Start and Full Config sections
- Expand "Get API Keys" section with all 4 search provider options
- Enhance troubleshooting section with detailed setup instructions for each provider
- Add SearXNG to API Key Comparison table (unlimited/self-hosted)

SearXNG benefits documented:
- Zero cost with no API fees or rate limits
- Privacy-focused self-hosted solution
- Aggregates 70+ search engines for comprehensive results
- Solves datacenter IP blocking issues on Oracle Cloud, GCP, AWS, Azure
- No API key required, just deploy and configure base URL

This documentation complements the code implementation in commit e7d8975.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Update config.example.json to include SearXNG web search provider
configuration alongside existing Brave, DuckDuckGo, and Perplexity options.

This ensures users have a complete reference for all available search
providers when setting up their PicoClaw instance.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
  Brave Search discontinued free tier on Feb 12, 2026.
  Updated all README references to reflect paid pricing.
  Emphasized SearXNG as free alternative.

  Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@sky5454
Copy link

sky5454 commented Feb 22, 2026

I think adding this will be convenient for users to aggregate their own information, but at the same time, we may also need to consider the hidden danger of config unlimited expansion. Maybe we can extract the tool or tool-web item of the configuration file and make it into a separate configuration file?

@IceWreck
Copy link

++ Having this would be great - lots of people using picoclaw would also be self hosting searxng.

@truongvinht
Copy link
Author

Update: fix merge conflict

@airpods69
Copy link

@truongvinht I did try this out with my locally hosted instance (built your branch)
but getting a 403 error :(

@airpods69
Copy link

okay nvm found it
https://stackoverflow.com/a/79056789

The problem is that by default the SearXNG seems to only support format=html. I don't know what is the best way to resolve this but you can get format=json working by editing /etc/searxng/settings.yml and adding json to the enabled search formats. Would be nice to have environment variable for this for the docker image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants